<?php
//	is_a($user, 'WP_User');
//	sfc_login_check($user);

/**
 * Header Template
 *
 * Here we setup all logic and XHTML that is required for the header section of all screens.
 *
 * @package WooFramework
 * @subpackage Template
 */
// Setup the tag to be used for the header area (`h1` on the front page and `span` on all others).
$heading_tag = 'span';
if (is_home() OR is_front_page()) {
  $heading_tag = 'h1';
}

// Get our website's name, description and URL. We use them several times below so lets get them once.
$site_title = get_bloginfo('name');
$site_url = home_url('/');
$site_description = get_bloginfo('description');

global $woo_options;
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
  <head>
	<meta charset="<?php bloginfo('charset'); ?>" />
	<title><?php woo_title(); ?></title>
	<?php woo_meta(); ?>
	<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="all" />
	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
	<?php
	if (is_singular()) {
	  wp_enqueue_script('comment-reply');
	}
	?>
<?php wp_head(); ?>
<?php woo_head(); ?>
	<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/style-custom.css" media="all" />
  </head>
  <body <?php body_class(); ?>>
	<?php woo_top(); ?>

		<?php woo_header_before(); ?>
	<div id="header">
	  <div class="wrapper">
		  <?php woo_header_inside(); ?>
		  <?php woo_sidebar("header-right"); ?>
		<div id="logo">
		  <?php
		  // Website heading/logo and description text.
		  if (isset($woo_options['woo_logo']) && $woo_options['woo_logo']) {
			echo '<a href="' . $site_url . '" title="' . $site_description . '"><img src="' . $woo_options['woo_logo'] . '" alt="' . $site_title . '" /></a>' . "\n";
		  } // End IF Statement

		  echo '<' . $heading_tag . ' class="site-title"><a href="' . $site_url . '">' . $site_title . '</a></' . $heading_tag . '>' . "\n";
		  if ($site_description) {
			echo '<span class="site-description">' . $site_description . '</span>' . "\n";
		  }
		  ?>
		</div><!-- /#logo -->

		<?php
		if (is_user_logged_in()) {
		  global $current_user;
		  get_currentuserinfo();
		  echo '<div class="welcome-user">Welcome <strong><a href="/edit-profile">' . $current_user->display_name . '</a></strong></div>';
		}

		?>


		  <?php if (( isset($woo_options['woo_ad_top']) ) && ( $woo_options['woo_ad_top'] == 'true' )) { ?>
  		<div id="topad">

			<?php
			if (( isset($woo_options['woo_ad_top_adsense']) ) && ( $woo_options['woo_ad_top_adsense'] != "")) {
			  echo stripslashes(get_option('woo_ad_top_adsense'));
			}
			else {
			  ?>
			  <a href="<?php echo get_option('woo_ad_top_url'); ?>"><img src="<?php echo $woo_options['woo_ad_top_image']; ?>" alt="" /></a>
		  <?php } ?>		   	
  		</div><!-- /#topad -->
		<?php } ?>
<!--		<div id="menuWrapper">
		  <ul><li><?php //woo_header_after(); ?></li>
		  <li><fb:login-button v="2" registration-url="/wp-login.php?action=register" scope="email,user_website" onlogin="window.location.href = '/wp-admin/';" class="fbWrap"/></li></ul>
		</div>-->

		<?php
		$menu_args = array(
		  'container' => false,
		  'menu_class'      => 'nav fl sf-js-enabled', 
		  'menu_id' => 'mainMenu'
		);
		?>
		  <div id="navigation" class="col-full">
			<?php wp_nav_menu($menu_args); ?>
			<fb:login-button v="2" size="small" registration-url="/wp-login.php?action=register" scope="email,user_website" onlogin="window.location.href = '/wp-admin/';" >Facebook Connect</fb:login-button>
		  </div>

	  </div>
	</div><!-- /#header -->
	<div id="wrapper">        